import request from '../../utils/request'

function getStaffData(data) {
  return request({
    url: '/user/findWithParameters',
    method: 'post',
    data
  })
}

function addStaff(data) {
  return request({
    url: '/user/add',
    method: 'post',
    data
  })
}

function updateStaff(data) {
  return request({
    url: '/user/modify',
    method: 'post',
    data
  })
}

function lockStaff(data) {
  return request({
    url: '/user/modify',
    method: 'post',
    data
  })
}
function queryCompany(data, queryType) {
  let res = {}
  res[queryType] = data[queryType]
  return request({
    url: '/company/page',
    method: 'post',
    data: {
      parameters: res, page: {
        pageSize: data.pageSize,
        pageIndex: data.pageIndex
      }
    }
  })
}

export {
  getStaffData,
  addStaff,
  updateStaff,
  lockStaff,
  queryCompany
}